package Java0307;

import java.util.Scanner;

public class SortDemo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("input three number:");
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        int num3 = sc.nextInt();
        int min = (num1 < num2 ? num1 : num2) < num3 ? (num1 < num2 ? num1 : num2) : num3;
        int max = (num1 > num2 ? num1 : num2) > num3 ? (num1 > num2 ? num1 : num2) : num3;
        //先入为主的使用三目运算符，发现中间的数字很难输出，暴力列举出所有的可能，无奈
        if (num1 > min && num1 < max) {
            System.out.println("从小到大排序：" + min + "," + num1 + "," + max);
        } else if (num2 > min && num2 < max) {
            System.out.println("从小到大排序：" + min + "," + num2 + "," + max);
        } else if (num3 > min && num3 < max) {
            System.out.println("从小到大排序：" + min + "," + num3 + "," + max);
        }
    }
}
